package cn.springcloudandalibaba.controller;

import cn.springcloudandalibaba.dao.Product;
import cn.springcloudandalibaba.dao.User;
import cn.springcloudandalibaba.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserServiceImpl orderService;
    @GetMapping("/getUser")
    public User GetUser(@RequestParam int id){
      return  orderService.GetUser(id);
    }
    @GetMapping("/getProduct")
    public Product GetProduct(@RequestParam int id){
        return  orderService.GetProduct(id);
    }
}
